home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0121_Text in mode 13h?.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  2KB  |  67 lines

  1.  
  2. { When you change modes, you lose the contents of the screen
  3. (cleared). It's all IBM's fault. You see, there is also a change in
  4. resolution and available colors and how video is used. It totally changes
  5. and that's a way of life on the PC. Sorry, no way around it but to use
  6. full graphics mode.
  7.  
  8.  FA> use, of course...) (I can't do it on a IBM, but ask me for C64-sources,
  9.  FA> if you want to have a look <grin>)
  10.  
  11. 320 x 200 x 256c, 13h, isn't the same as the resolution required for 80x50
  12. text (640 x 400 x 256). In that case, I have seen graphics (simple) under
  13. text in text mode. If you're forced to change resolution, kiss it all good
  14. bye.
  15.  
  16. Run this under text: }
  17.  
  18. {$A+,B-,E-,F-,G+,I-,L-,N-,O-,R-,S-,V-,X-}
  19.  
  20. program RedBar;
  21.  
  22. VAR
  23.   C:Byte;
  24.   C2,C3,C4:Word;
  25.   SINTAB:Array[0..127] of Word;
  26.   HeadPtr:Word absolute $40:$1A;
  27.   TailPtr:Word absolute $40:$1C;
  28.  
  29. begin;
  30.   for c:=0 to 127 do
  31.     sintab[c]:=Trunc((Sin((2*Pi/128)*C)+1)*135);
  32.   C3:=0;
  33.   REPEAT
  34.     INLINE($FA);
  35.  
  36.     repeat until (port[$3da] and 8)>0;
  37.     repeat until (port[$3da] and 8)=0;
  38.     for c4:=0 to sintab[c3 and 127] do begin
  39.       repeat until (port[$3da] and 1)=0;
  40.       repeat until (port[$3da] and 1)>0;
  41.     end;
  42.     for c:=0 to 63 do begin
  43.       repeat until (port[$3da] and 1)>0;
  44.       Port[$3C8]:=0;
  45.       Port[$3C9]:=C;
  46.       Port[$3C9]:=0;
  47.       Port[$3C9]:=0;
  48.       repeat until (port[$3Da] and 1)=0;
  49.     end;
  50.  
  51.     for c:=63 downto 0 do begin;
  52.       repeat until (port[$3Da] and 1)>0;
  53.       Port[$3C8]:=0;
  54.       Port[$3C9]:=C;
  55.       Port[$3C9]:=0;
  56.       Port[$3C9]:=0;
  57.       Repeat until (port[$3da] and 1)=0;
  58.     end;
  59.  
  60.     port[$3C8]:=0;
  61.     port[$3c9]:=0;port[$3c9]:=0;Port[$3c9]:=0;
  62.     Inc(C3);
  63.     inline($FB);
  64.   until headptr<>tailptr;
  65.   headptr:=tailptr;
  66. end.
  67.